<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
	name="viewport">
<link rel="stylesheet" href="<%=basePath%>statics/css/bootstrap-2.3.css">
<title>山西旅游网站</title>
</head>
<body onLoad="checksession();" style="background-image:url('<%=basePath%>statics/images/main.png');background-size:100% 100%;">
<div class="container-fluid" >
		<div class="row-fluid">
			<div class="span12">
				<div class="row-fluid">
					<div class="span12">
						<div class="span4"></div>
						<div class="span4">
							<h3>华夏古文明-山西好风光----设计成图片</h3>
						</div>
						<div class="span4"></div>
					</div>
				</div>
				<div class="row-fluid">
					<div class="span2"></div>
					<div class="span8">
						<div class="navbar">
							<div class="navbar-inner">
								<div class="container-fluid">
									<a data-target=".navbar-responsive-collapse"
										data-toggle="collapse" class="btn btn-navbar"><span
										class="icon-bar"></span><span class="icon-bar"></span><span
										class="icon-bar"></span></a> <a href="<%=basePath%>front/index.jsp" class="brand">山西旅游网</a>
									<div class="nav-collapse collapse navbar-responsive-collapse">
										<ul class="nav">
											<li ><a href="<%=basePath%>front/index.jsp">主页</a></li>
											<li class="dropdown"><a data-toggle="dropdown"
												class="dropdown-toggle" href="#">大好山西<strong
													class="caret"></strong></a>
												<ul class="dropdown-menu" id="citylistid">
												</ul>
											</li>
											<li class="dropdown"><a data-toggle="dropdown"
												class="dropdown-toggle" href="#">主要景点<strong
													class="caret"></strong></a>
												<ul class="dropdown-menu" id="infolistid">
												</ul></li>
											<li class="dropdown active"><a data-toggle="dropdown"
												class="dropdown-toggle" href="#">山水旅游<strong
													class="caret"></strong></a>
												<ul class="dropdown-menu" id="categorylistid">
												</ul>
											</li>
											<li></li>
											<li><a href="picture.jsp">读图之美</a></li>
											<li><a href="twork.jsp">意见与建议</a></li>
										</ul>
										<ul class="nav pull-right">
											<li><a href="user_login.jsp" id="login">游客登录</a></li>
											<li><a href="user_regedit.jsp" id="regedit">游客注册</a></li>
											<li><a href="<%=basePath%>api/user/logout" id="logout"></a></li>
										</ul>
									</div>

								</div>

							</div>
						</div>

					</div>
					<div class="span2"></div>
				</div>
				<div class="row-fluid">
					<div class="span12">
						<div class="row-fluid">
							<div class="span2"></div>

							<div class="span8">
								<div class="span3" style="border: 1px solid #ddd;">
									<ul class="nav nav-list" id="category_left_nav">
										<center>
											<h3>山水旅游</h3>
										</center>
										<li class="divider"></li>
									</ul>

								</div>
								<div class="span9" style="border: 1px solid #ddd;">

									<div class="content-head">
										<br>
										<div class="span0.5	">返回首页 > 概括 > ${category.name}</div>
										<div class="span0.5"></div>
										<input type="hidden" id="categoryid" value="${category.id}">
									</div>

									<div class="container-fluid">
										<div class="row-fluid">
											<div class="span12">
												<ul class="thumbnails" id="getInfoByCategoryid">
												</ul>
											</div>
										</div>
									</div>
								</div>

							</div>
						</div>
						<div class="span2"></div>
					</div>
				</div>
			</div>


			<div class="row-fluid">
				<div class="span2"></div>
				<div class="span6">
					<center>Copyright 2018 Inc.All rights reserved. 旅游网 版权所有
						晋ICP备xxxxx号-1</center>
				</div>
				<div class="span4"></div>
			</div>
		</div>
	</div>
	</div>
</body>
</html>
<script src="<%=basePath%>statics/libs/jquery.min.js"></script>
<script src="<%=basePath%>statics/libs/vue.min.js"></script>
<script src="<%=basePath%>statics/libs/router.js"></script>
<script src="<%=basePath%>statics/libs/bootstrap.min.js"></script>
<script>
	$(function() {
		$('#carousel-339691').carousel({
			interval : 3000
		});
	});
    //主要菜单-城市菜单
    $.ajax({
        url : "<%=basePath%>api/tcity/list",
        data : "",
        success : function(data) {
            var json=JSON.parse(data).cityList;
            $.each(json, function(index, item) {
                var a='<li><a href="<%=basePath%>api/tcity/info?id='+item.id+'">'+item.cityName+'</a></li>';
                $("#citylistid").append(a);
            });
        }
    });
    //主要菜单-分类菜单
    $.ajax({
        url : "<%=basePath%>api/category/list",
        data : "",
        success : function(data) {
            var json=JSON.parse(data).categoryList;
            $.each(json, function(index, item) {
                var a='<li><a href="<%=basePath%>api/category/info?id='+item.id+'">'+item.name+'</a></li>';
                var b='<li><a href="<%=basePath%>api/category/info?id='+item.id+'" class="text-center" style="border-bottom-style: solid;">' +
					'<center><h5>'+item.name+'</h5></center></a></li>';
                $("#categorylistid").append(a);
                $("#category_left_nav").append(b);
            });
        }
    });
    var categoryid=$("#categoryid").val();
    $.ajax({
        url : "<%=basePath%>api/category/getInfoList?id="+categoryid,
        data : "",
        success : function(data) {
            var json=JSON.parse(data).InfoList;
            $.each(json, function(index, item) {
                var id=item.id;
                var html='<li class="span4" ><div class="thumbnail" ><img alt="300x200" src="'+item.tourImage+'" />\n' +
                    '<div class="caption">\n' +
                    '<h3>'+item.tourName+'</h3><p style="height:60px;overflow:hidden;display:block;">'+item.tourInfo+'</p>\n' +
                    '<p><a class="btn btn-primary" onclick="ajax_info('+id+')" href="javascript:void(0);">更多信息</a></p>\n' +
                    '</div></div></li>';
                $("#getInfoByCategoryid").append(html);
            });
        }
    });
    //ajax_info 景点详细信息
    function ajax_info(id) {
        $.ajax({
            url : "<%=basePath%>api/info/getInfoById?id="+id,
            data : "",
            success : function(data) {
                $("#getInfoByCategoryid").empty();
                var InfoEntity=JSON.parse(data).InfoEntity;
                var html='<div><img alt="300x200" src="'+InfoEntity.tourImage+'" /></div><br>'+InfoEntity.tourInfo+'';
                $("#getInfoByCategoryid").append(html);
            }
        });
    }
    //主要菜单-景点导航
    $.ajax({
        url : "<%=basePath%>api/info/list",
        data : "",
        success : function(data) {
            var InfoList=JSON.parse(data).InfoList;
            var length=InfoList.length;
            for(var i=length-1;i>length-6;i--){
                var html='<li><a href="<%=basePath%>api/info/info?id='+InfoList[i].id+'">'+InfoList[i].tourName+'</a></li>';
                $('#infolistid').append(html)
            }
            var html='<li><a href="#">更多景点</a></li>';
            $('#infolistid').append(html)
        }
    });
    function checksession()
    {
        var strSession = '<%=session.getAttribute("user_login")%>';
        if( strSession !='null')
        {
            document.getElementById("regedit").innerText = "";
            document.getElementById("login").innerText = "";
            document.getElementById("logout").innerText = "注销";
        }
    }
</script>
